<%@ include file="/common/taglibs.jsp"%>
<%@ page import="java.math.BigDecimal"
	contentType="text/html; charset=UTF-8"%>
<title>客户端验证框架测试页</title>

<form class="mainForm" action="testValidate.html" onsubmit="validateFormWithMsg(this);return false;">

<table style="width:800px" cellspacing="0" cellpadding="0" border="0" class="dataintable">
	<tr>
		<th width="200px;">前端验证项</th>
		<td>验证field</td>
	</tr>
	<tr>
		<th>radio</th>
		<td>
			<input id="radio" type="radio" name="radioVal" value="radio1">
			radio1
			<input type="radio" name="radioVal" value="radio2" />
			radio2
			<input type="radio" name="radioVal" value="radio3" />
			radio3
		</td>
	</tr>
	<tr>
		<th>checkbox</th>
		<td>
			<input id="checkboxVal" type="checkbox" name="checkboxVal" value="checkbox1" validConf="required">
			checkbox1
			<input type="checkbox" name="checkboxVal" value="checkbox2" />
			checkbox2
			<input type="checkbox" name="checkboxVal" value="checkbox3" />
			checkbox3
		</td>
	</tr>
	<tr>
		<th>number</th>
		<td>
			<input id="numberVal"  name="numberVal" value="" type="text" validConf="number"/>
		</td>
	</tr>
	<tr>
		<th>integer</th>
		<td>
			<input id="integerVal" name="integerVal"  value="" type="text" validConf="integer"/>
		</td>
	</tr>
	<tr>
		<th>positiveInteger</th>
		<td>
			<input id="positiveIntegerVal"  name="positiveIntegerVal"  value="" type="text" validConf="positiveInteger"/>
		</td>
	</tr>
	<tr>
		<th>short</th>
		<td>
			<input id="shortVal"  name="shortVal"  value="" type="text" validConf="short"/>
		</td>
	</tr>
	<tr>
		<th>double</th>
		<td>
			<input id="doubleVal" name="doubleVal"  value="" type="text" validConf="double"/>
		</td>
	</tr>
	<tr>
		<th>double4</th>
		<td>
			<input id="double4Val" name="double4Val"  value="" type="text" validConf="double4"/>
		</td>
	</tr>
	<tr>
		<th>intRange</th>
		<td>	
			<input id="intRangeVal"  name="intRangeVal" value="" type="text" validConf="intRange=[0-200]"/>
		</td>
	</tr>
	<tr>
		<th>floatRange</th>
		<td>	
			<input id="floatRangeVal"  name="floatRangeVal" value="" type="text" validConf="floatRange=[100-200.5]"/>
		</td>
	</tr>
	<tr>
		<th>price</th>
		<td>
			<input id="priceVal"  name="priceVal" value="" type="text" validConf="price"/>
		</td>
	</tr>
	<tr>
		<th>money</th>
		<td>
			<input id="moneyVal"  name="moneyVal" value="" type="text" validConf="money"/>
		</td>
	</tr>
	<tr>
		<th>code</th>
		<td>
			<input id="codeVal" name="codeVal"  value="" type="text" validConf="code"/>
		</td>
	</tr>
	<tr>
		<th>chineseCode</th>
		<td>	
			<input id="chineseCodeVal" name="chineseCodeVal"  value="" type="text" validConf="chineseCode"/>
		</td>
	</tr>
	<tr>
		<th>noHtml</th>
		<td>	
			<input id="noHtmlVal"  name="noHtmlVal" value="" type="text" validConf="noHtml"/>
		</td>
	</tr>
	<tr>
		<th>phone</th>
		<td>
			<input id="phoneVal"  name="phoneVal" value="" type="text" validConf="phone"/>
		</td>
	</tr>
	<tr>
		<th>mobile</th>
		<td>
			<input id="mobileVal"  name="mobileVal" value="" type="text" validConf="mobile"/>
		</td>
	</tr>
	<tr>
		<th>email</th>
		<td>
			<input id="emailVal"  name="emailVal" value="" type="text" validConf="email"/>
		</td>
	</tr>
	<tr>
		<th>url</th>
		<td>
			<input id="urlVal"  name="urlVal" value="" type="text" validConf="url"/>
		</td>
	</tr>
	
	<tr>
		<th>date</th>
		<td>	
			<input id="dateVal"  name="dateVal" value="" type="text" validConf="date"/>
		</td>
	</tr>
	<tr>
		<th>mask</th>
		<td>	
			<input id="maskVal"  name="maskVal" value="" type="text" validConf="mask=^[\d]*$"/>
		</td>
	</tr>
	<tr>
		<th>twofields</th>
		<td>	
			<input id="twofields1"  name="twofields1Val" value="" type="text" />
			<input id="twofields2"  name="twofields2Val" value="" type="text" validConf="twofields=twofields1"/>
		</td>
	</tr>
	
</table>
<input type="hidden" name="doAction" value="save2"/>
<input type="submit" value="Submit" >
</form>
<script type="text/javascript">
$j(document).ready(function(){
	autoApplyValidate();
	//增加number的必填验证
	applyValidate($("numberVal"),"required,number");
	//移除number的所有验证
	//removeValidate($("numberVal"));
});
</script>
